package com.icangya.service.impl;

import com.icangya.DAO.IFbMissionAwardDAO;
import com.icangya.DAO.IFbTurntableRecordDAO;
import com.icangya.domain.FbMissionAward;
import com.icangya.domain.FbTurntableRecord;
import com.icangya.service.IMissionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("MissionServiceImpl")
public class MissionServiceImpl implements IMissionService {


    @Autowired
    private IFbMissionAwardDAO iFbMissionAwardDAO;


    @Autowired
    private IFbTurntableRecordDAO iFbTurntableRecordDAO;



    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Override
    public List<FbMissionAward> getFbMissionAward() {
        return iFbMissionAwardDAO.getMissionAward();
    }

    @Override
    public List<FbMissionAward> getMissionAwardByStatus(int site) {
        return iFbMissionAwardDAO.getMissionAwardByStatus(site);
    }

    //获取可领取的奖励
    @Override
    public List<FbMissionAward> getMissionAwardStatus(int site) {
        return iFbMissionAwardDAO.getMissionAwardStatus(site);
    }

    @Override
    public FbMissionAward getMissionAward(long awardId) {

        return iFbMissionAwardDAO.get(awardId);
    }

    @Override
    public Boolean updateMissionAward(FbMissionAward fbMissionAward) {

        return iFbMissionAwardDAO.update(fbMissionAward);
    }



    @Override
    public FbTurntableRecord saveFbTurntableRecord(FbTurntableRecord turntableRecord) {
        return iFbTurntableRecordDAO.get(iFbTurntableRecordDAO.save(turntableRecord));
    }

    @Override
    public boolean updateTurntableRecord(FbTurntableRecord turntableRecord) {
        return iFbTurntableRecordDAO.update(turntableRecord);
    }

    @Override
    public List getTurntableRecordByOpenId(String openId, int startPage) {
        return iFbTurntableRecordDAO.getTurntableRecordByOpenId(openId,startPage);
    }

    //查询用户使用转盘的记录
    @Override
    public  List<FbTurntableRecord> getTurntableRecordByOpenId(String openId) {
        return iFbTurntableRecordDAO.getTurntableRecordByOpenId(openId);
    }



}
























